-
-
Notifications
You must be signed in to change notification settings - Fork 12
Display self hosted runners status #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9130cfb to
63b9bfd
Compare
8552cf4 to
d58dfe2
Compare
e186b6c to
71277f9
Compare
71277f9 to
8446899
Compare
|
Warning Rate limit exceeded@igorpecovnik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 24 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds a new GitHub Actions workflow at Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Nitpick comments (5)
.github/workflows/generate-runners-status.yml (5)
9-12: Enable concurrency to avoid overlapping runs and inconsistent summariesUncomment and set a stable group; cancel in-progress for push to keep latest-only results.
-#concurrency: -# group: redirector -# cancel-in-progress: false +concurrency: + group: generate-runners-status + cancel-in-progress: true
34-39: Pin cache-apt action and consider a hard timeoutLock the action to a commit SHA and cap runtime to prevent hanging builds.
-uses: awalsh128/cache-apt-pkgs-action@latest +uses: awalsh128/cache-apt-pkgs-action@<commit-sha>You can also add a per-job timeout:
build: name: "Get self hosted runners status" runs-on: ubuntu-24.04 needs: Check + timeout-minutes: 15
3-8: Optional: re-enable a schedule for up-to-date statusIf you want an always-fresh overview, re-enable the hourly cron (or daily) and keep workflow_dispatch.
-# schedule: -# - cron: '0 * * * *' # Run every hour + schedule: + - cron: '0 * * * *' # Run every hour
40-74: General shell hardening and minor nits
- Add set -Eeuo pipefail (already shown above).
- Quote all variables when echoed/printf.
- Replace useless use of cat with direct jq reads.
Example:
- INFO=$(cat runners.json | jq -r '...') + INFO=$(jq -r '...' runners.ndjson)
56-59: Confirm slug filter usage; optional-sSflag and empty-state guard
NetBox’s/virtualization/virtual-machines/?role=<slug>endpoint accepts slug values (e.g.role=userlevel-runner), so no change is needed to the filter. Optionally, replacecurl -swithcurl -sSto surface HTTP errors and add after capturing$SERVERS:if [[ -z "$SERVERS" ]]; then echo "<tr><td colspan=5><i>No active user-level runners found.</i></td></tr>" >> "$GITHUB_STEP_SUMMARY" fiThis ensures any empty result set is handled gracefully.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-runners-status.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Get from Armbian Jira
92e9417 to
ad7bfa0
Compare
6125b8e to
9796115
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
♻️ Duplicate comments (2)
.github/workflows/generate-runners-status.yml (2)
3-8: Restrict triggers and add least-privilege permissionsLimit push to main to avoid unneeded runs; explicitly scope GITHUB_TOKEN.
on: push: + branches: + - main schedule: - cron: '0 * * * *' # Run every hour workflow_dispatch: # Manually triggered via GitHub Actions UI + +permissions: + actions: read + contents: read
21-26: Pin third‑party actions by commit SHAAvoid floating refs (@main) for supply‑chain safety.
-uses: armbian/actions/team-check@main +# TODO: replace <commit-sha> with audited immutable commit +uses: armbian/actions/team-check@<commit-sha>
🧹 Nitpick comments (4)
.github/workflows/generate-runners-status.yml (4)
9-12: Enable concurrency to avoid overlapping hourly runsPrevent multiple scheduled executions from piling up.
-#concurrency: -# group: redirector -# cancel-in-progress: false +concurrency: + group: generate-runners-status + cancel-in-progress: true
40-48: Redundant GH_TOKEN assignmentYou set GH_TOKEN in env and again inside the script. Keep one.
- - name: "Get runners from ORG" - env: - GH_TOKEN: ${{ secrets.RUNNERS }} - run: | - - GH_TOKEN=${{ secrets.RUNNERS }} + - name: "Get runners from ORG" + env: + GH_TOKEN: ${{ secrets.RUNNERS }} + run: |
82-87: Potential NetBox pagination gaplimit=500 may truncate results. Consider following next if present.
- curl -s \ + curl -sS \ -H "Authorization: Token ${NETBOX_TOKEN}" \ -H "Accept: application/json; indent=4" \ - "${NETBOX_API}/virtualization/virtual-machines/?limit=500&name__empty=false&tag=github-runner&status=active" \ + "${NETBOX_API}/virtualization/virtual-machines/?limit=500&name__empty=false&tag=github-runner&status=active" \ > "$nb_json" +# TODO: If nb_json has .next, iterate and merge .results
134-139: Quote $GITHUB_STEP_SUMMARY everywhereMinor, but consistent quoting avoids surprises.
printf "<tr><th colspan=2 align=right>Totals:</th><th align=right>%d</th><th align=right>%d</th><th align=right>%d</th><th align=right>%d</th></tr>\n" \ - "$total_cpu" "$total_mem_gb" "$total_storage_gb" "$total_runners" >> $GITHUB_STEP_SUMMARY + "$total_cpu" "$total_mem_gb" "$total_storage_gb" "$total_runners" >> "$GITHUB_STEP_SUMMARY" - echo "</table>" >> $GITHUB_STEP_SUMMARY + echo "</table>" >> "$GITHUB_STEP_SUMMARY"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/generate-runners-status.yml(1 hunks)
🔇 Additional comments (1)
.github/workflows/generate-runners-status.yml (1)
98-107: Verify label vs name for runner prefixYou switched from NAME-XX to LABELS-XX. Confirm this matches actual configured runner names to avoid false “offline”.
| Check: | ||
|
|
||
| name: "Check permissions" | ||
| runs-on: "ubuntu-22.04" | ||
| steps: | ||
|
|
||
| - name: "Check permissions" | ||
| uses: armbian/actions/team-check@main | ||
| with: | ||
| ORG_MEMBERS: ${{ secrets.ORG_MEMBERS }} | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TEAM: "Release manager" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scheduled runs will always fail the Check job
On schedule, the actor is github-actions[bot], not a human team member, so team-check fails and blocks build. Gate Check to non-scheduled events (or invert needs on build).
Check:
+ if: github.event_name != 'schedule'
name: "Check permissions"
runs-on: "ubuntu-22.04"
steps:
- name: "Check permissions"
- uses: armbian/actions/team-check@main
+ uses: armbian/actions/team-check@main📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Check: | |
| name: "Check permissions" | |
| runs-on: "ubuntu-22.04" | |
| steps: | |
| - name: "Check permissions" | |
| uses: armbian/actions/team-check@main | |
| with: | |
| ORG_MEMBERS: ${{ secrets.ORG_MEMBERS }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TEAM: "Release manager" | |
| Check: | |
| if: github.event_name != 'schedule' | |
| name: "Check permissions" | |
| runs-on: "ubuntu-22.04" | |
| steps: | |
| - name: "Check permissions" | |
| uses: armbian/actions/team-check@main | |
| with: | |
| ORG_MEMBERS: ${{ secrets.ORG_MEMBERS }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TEAM: "Release manager" |
🤖 Prompt for AI Agents
.github/workflows/generate-runners-status.yml around lines 15-27: the scheduled
workflow runs as github-actions[bot] so the team-check step (which verifies a
human team membership) will always fail on schedule; to fix, gate the Check
job/step so it does not run for scheduled events by adding a condition like if:
${{ github.event_name != 'schedule' }} (apply to the job or the specific step),
or alternatively adjust job dependencies so the build does not need the Check
job for schedule-triggered runs.
| - name: "Install dependencies: jq" | ||
| uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: jq | ||
| version: 1.0 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid @latest; either pin by SHA or use apt-get directly
Pin the action or switch to native apt for simplicity.
- - name: "Install dependencies: jq"
- uses: awalsh128/cache-apt-pkgs-action@latest
- with:
- packages: jq
- version: 1.0
+ - name: "Install jq"
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y jq📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: "Install dependencies: jq" | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: jq | |
| version: 1.0 | |
| - name: "Install jq" | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y jq |
🤖 Prompt for AI Agents
.github/workflows/generate-runners-status.yml around lines 34-39: the workflow
currently uses the third-party action with @latest which is not pinned; either
pin the action to a specific commit SHA (e.g. replace @latest with
@<commit-sha>) to ensure reproducible builds, or remove the action and install
jq directly using native apt in a run step (e.g. run: sudo apt-get update &&
sudo apt-get install -y jq) and remove the uses/with block.
| tmp="$(mktemp -d)" | ||
| trap 'rm -rf "$tmp"' EXIT | ||
|
|
||
| runners_nd="$tmp/runners.ndjson" | ||
| out_html="$tmp/runners_summary.html" | ||
| : > "$runners_nd" | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Harden script execution
Enable strict mode; drop unused out_html var.
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
runners_nd="$tmp/runners.ndjson"
- out_html="$tmp/runners_summary.html"
: > "$runners_nd"
+ set -Eeuo pipefail📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| tmp="$(mktemp -d)" | |
| trap 'rm -rf "$tmp"' EXIT | |
| runners_nd="$tmp/runners.ndjson" | |
| out_html="$tmp/runners_summary.html" | |
| : > "$runners_nd" | |
| tmp="$(mktemp -d)" | |
| trap 'rm -rf "$tmp"' EXIT | |
| runners_nd="$tmp/runners.ndjson" | |
| : > "$runners_nd" | |
| set -Eeuo pipefail |
🤖 Prompt for AI Agents
.github/workflows/generate-runners-status.yml around lines 49 to 55: enable
strict shell mode and remove the unused out_html variable; add a safe
shebang/session options by inserting set -euo pipefail and IFS=$'\n\t' near the
top of the script (or before this block) so the script fails fast on
errors/unset variables and handles word splitting safely, and delete the
out_html="$tmp/runners_summary.html" assignment since out_html is unused; keep
tmp="$(mktemp -d)" and the trap as-is and ensure the rest of the script
references "$runners_nd" only.
| # Fetch ALL GitHub org runners (prefer gh; fallback to curl) | ||
| if command -v gh >/dev/null 2>&1; then | ||
| gh api \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| --paginate /orgs/armbian/actions/runners \ | ||
| -q '.runners[]' > "$runners_nd" | ||
| else | ||
| curl -fsSL \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${GH_TOKEN}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "https://api.github.com/orgs/armbian/actions/runners?per_page=100" \ | ||
| | jq -c '.runners[]' > "$runners_nd" | ||
| fi | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curl fallback fetches only first page (misses >100 runners)
Paginate until empty or Link header exhausted.
else
- curl -fsSL \
- -H "Accept: application/vnd.github+json" \
- -H "Authorization: Bearer ${GH_TOKEN}" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- "https://api.github.com/orgs/armbian/actions/runners?per_page=100" \
- | jq -c '.runners[]' > "$runners_nd"
+ page=1
+ while :; do
+ resp="$(curl -fsSL \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${GH_TOKEN}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ "https://api.github.com/orgs/armbian/actions/runners?per_page=100&page=${page}")"
+ count="$(jq '.runners | length' <<<"$resp")"
+ [[ "${count}" -eq 0 ]] && break
+ jq -c '.runners[]' <<<"$resp" >> "$runners_nd"
+ page=$((page+1))
+ done
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Fetch ALL GitHub org runners (prefer gh; fallback to curl) | |
| if command -v gh >/dev/null 2>&1; then | |
| gh api \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| --paginate /orgs/armbian/actions/runners \ | |
| -q '.runners[]' > "$runners_nd" | |
| else | |
| curl -fsSL \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${GH_TOKEN}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "https://api.github.com/orgs/armbian/actions/runners?per_page=100" \ | |
| | jq -c '.runners[]' > "$runners_nd" | |
| fi | |
| # Fetch ALL GitHub org runners (prefer gh; fallback to curl) | |
| if command -v gh >/dev/null 2>&1; then | |
| gh api \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| --paginate /orgs/armbian/actions/runners \ | |
| -q '.runners[]' > "$runners_nd" | |
| else | |
| page=1 | |
| while :; do | |
| resp="$(curl -fsSL \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${GH_TOKEN}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| "https://api.github.com/orgs/armbian/actions/runners?per_page=100&page=${page}")" | |
| count="$(jq '.runners | length' <<<"$resp")" | |
| [[ "${count}" -eq 0 ]] && break | |
| jq -c '.runners[]' <<<"$resp" >> "$runners_nd" | |
| page=$((page+1)) | |
| done | |
| fi |
🤖 Prompt for AI Agents
.github/workflows/generate-runners-status.yml around lines 56 to 71: the curl
fallback currently fetches only the first page (up to 100 runners) and will miss
additional pages; change the fallback to loop and paginate until no more pages
(either by following the Link header or incrementing a page counter with
?per_page=100&page=N) and append each page's runners to the output file,
preserving the same headers/authorization and using jq to extract '.runners[]'
for each page; ensure the loop breaks when the response has no runners or when
the Link header indicates no "next" link.
| # Render to stdout and to HTML file | ||
| echo "<table border=0>" >> $GITHUB_STEP_SUMMARY | ||
| echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| # init totals | ||
| total_cpu=0 | ||
| total_mem_gb=0 | ||
| total_storage_gb=0 | ||
| total_runners=0 | ||
|
|
||
| while IFS=$'\t' read -r NAME CPU MEM_MB DISK_GB RUNNERS LABELS ID; do | ||
| CALC_MEM=$(( (MEM_MB + 512) / 1024 )) | ||
| printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \ | ||
| "$NAME" "$LABELS" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Escape HTML and quote file path
Names/labels from NetBox may contain special chars; escape to avoid broken markup. Also quote $GITHUB_STEP_SUMMARY.
- echo "<table border=0>" >> $GITHUB_STEP_SUMMARY
- echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> $GITHUB_STEP_SUMMARY
+ echo "<table border=0>" >> "$GITHUB_STEP_SUMMARY"
+ echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> "$GITHUB_STEP_SUMMARY"
@@
- printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \
- "$NAME" "$LABELS" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> $GITHUB_STEP_SUMMARY
+ esc_name=$(jq -Rr @html <<<"$NAME")
+ esc_labels=$(jq -Rr @html <<<"$LABELS")
+ printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \
+ "$esc_name" "$esc_labels" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> "$GITHUB_STEP_SUMMARY"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Render to stdout and to HTML file | |
| echo "<table border=0>" >> $GITHUB_STEP_SUMMARY | |
| echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> $GITHUB_STEP_SUMMARY | |
| # init totals | |
| total_cpu=0 | |
| total_mem_gb=0 | |
| total_storage_gb=0 | |
| total_runners=0 | |
| while IFS=$'\t' read -r NAME CPU MEM_MB DISK_GB RUNNERS LABELS ID; do | |
| CALC_MEM=$(( (MEM_MB + 512) / 1024 )) | |
| printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \ | |
| "$NAME" "$LABELS" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> $GITHUB_STEP_SUMMARY | |
| # Render to stdout and to HTML file | |
| echo "<table border=0>" >> "$GITHUB_STEP_SUMMARY" | |
| echo "<tr><th align=left>Server</th><th align=left>Runner label</th><th align=right>CPU cores</th><th align=right>Memory GB</th><th align=right>Storage GB</th><th align=right>Runners</th></tr>" >> "$GITHUB_STEP_SUMMARY" | |
| # init totals | |
| total_cpu=0 | |
| total_mem_gb=0 | |
| total_storage_gb=0 | |
| total_runners=0 | |
| while IFS=$'\t' read -r NAME CPU MEM_MB DISK_GB RUNNERS LABELS ID; do | |
| CALC_MEM=$(( (MEM_MB + 512) / 1024 )) | |
| esc_name=$(jq -Rr @html <<<"$NAME") | |
| esc_labels=$(jq -Rr @html <<<"$LABELS") | |
| printf "<tr><td>%s</td><td>%s</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td><td align=right>%d</td></tr>\n" \ | |
| "$esc_name" "$esc_labels" "$CPU" "$CALC_MEM" "$DISK_GB" "$RUNNERS" >> "$GITHUB_STEP_SUMMARY" |
🤖 Prompt for AI Agents
In .github/workflows/generate-runners-status.yml around lines 88-101, the NAME
and LABELS values from NetBox are not HTML-escaped and the redirection target is
unquoted; update the script to HTML-escape special characters (&, <, >, ", ') in
NAME and LABELS (e.g., create a small function that replaces those characters
with &, <, >, ", ' and call it for NAME and LABELS before
printing) and change all redirections to quote the summary file variable (use
"$GITHUB_STEP_SUMMARY" instead of $GITHUB_STEP_SUMMARY) so markup cannot be
broken and the filename with spaces is handled safely.
| echo "<tr><td colspan=6>" >> $GITHUB_STEP_SUMMARY | ||
| if [[ "$RUNNERS" -gt 0 ]]; then | ||
| for i in $(seq -f "%02g" 1 "$RUNNERS"); do | ||
| rn="${LABELS}-${i}" | ||
| if [[ -n "${RUNNER_STATUS[$rn]:-}" || "$LABELS" == "github" ]]; then | ||
| printf "🟢" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| printf "🔴 <small>(%s)</small> " "$i" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
| done | ||
| fi | ||
| echo "</td></tr>" >> $GITHUB_STEP_SUMMARY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don’t mark offline runners as green; use real status (+busy) and quote path
Presence in the API isn’t “online”. Render online/idle/busy vs offline.
- echo "<tr><td colspan=6>" >> $GITHUB_STEP_SUMMARY
+ echo "<tr><td colspan=6>" >> "$GITHUB_STEP_SUMMARY"
if [[ "$RUNNERS" -gt 0 ]]; then
for i in $(seq -f "%02g" 1 "$RUNNERS"); do
rn="${LABELS}-${i}"
- if [[ -n "${RUNNER_STATUS[$rn]:-}" || "$LABELS" == "github" ]]; then
- printf "🟢" >> $GITHUB_STEP_SUMMARY
- else
- printf "🔴 <small>(%s)</small> " "$i" >> $GITHUB_STEP_SUMMARY
- fi
+ status="${RUNNER_STATUS[$rn]:-}"
+ busy="${RUNNER_BUSY[$rn]:-false}"
+ if [[ "$LABELS" == "github" ]]; then
+ icon="🟢"
+ elif [[ "$status" == "online" ]]; then
+ icon="🟢"
+ elif [[ -n "$status" ]]; then
+ icon="🟡"
+ else
+ icon="🔴"
+ fi
+ [[ "$busy" == "true" ]] && icon="${icon}🔥"
+ printf "%s <small>(%s)</small> " "$icon" "$i" >> "$GITHUB_STEP_SUMMARY"
done
fi
- echo "</td></tr>" >> $GITHUB_STEP_SUMMARY
+ echo "</td></tr>" >> "$GITHUB_STEP_SUMMARY"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| echo "<tr><td colspan=6>" >> $GITHUB_STEP_SUMMARY | |
| if [[ "$RUNNERS" -gt 0 ]]; then | |
| for i in $(seq -f "%02g" 1 "$RUNNERS"); do | |
| rn="${LABELS}-${i}" | |
| if [[ -n "${RUNNER_STATUS[$rn]:-}" || "$LABELS" == "github" ]]; then | |
| printf "🟢" >> $GITHUB_STEP_SUMMARY | |
| else | |
| printf "🔴 <small>(%s)</small> " "$i" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| fi | |
| echo "</td></tr>" >> $GITHUB_STEP_SUMMARY | |
| echo "<tr><td colspan=6>" >> "$GITHUB_STEP_SUMMARY" | |
| if [[ "$RUNNERS" -gt 0 ]]; then | |
| for i in $(seq -f "%02g" 1 "$RUNNERS"); do | |
| rn="${LABELS}-${i}" | |
| status="${RUNNER_STATUS[$rn]:-}" | |
| busy="${RUNNER_BUSY[$rn]:-false}" | |
| if [[ "$LABELS" == "github" ]]; then | |
| icon="🟢" | |
| elif [[ "$status" == "online" ]]; then | |
| icon="🟢" | |
| elif [[ -n "$status" ]]; then | |
| icon="🟡" | |
| else | |
| icon="🔴" | |
| fi | |
| [[ "$busy" == "true" ]] && icon="${icon}🔥" | |
| printf "%s <small>(%s)</small> " "$icon" "$i" >> "$GITHUB_STEP_SUMMARY" | |
| done | |
| fi | |
| echo "</td></tr>" >> "$GITHUB_STEP_SUMMARY" |
No description provided.